using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ShootThemUp.Sources.GameElements.Ships.Ennemies.Waves.Trajectories
{
    public class ParaboleSemiCubiqueTrajectory : IWaveTrajectory
    {
        private int y;
        private int x;
        private Boolean direction;
        private int coef;

        public ParaboleSemiCubiqueTrajectory(int x, int y, int a, Boolean dir)
        {
            this.Y = y;
            this.x = x;
            this.direction = dir;
            this.coef = a;
        }

        private int Y
        {
            get { return y; }
            set { y = value; }
        }

        public int GetX(float t)
        {
            int result = (int) (this.coef*Math.Pow(t,2));
            if (!this.direction)
            {
                result = GameStateManagement.DEFAULT_PORTRAIT_SCREEN_WIDTH - result;
            }
            return  result;
        }

        public int GetY(float t)
        {
            int result = (int) (this.coef*Math.Pow(t,3));

            return result;
        }
    }
}
